import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
state: {
isLogin: localStorage.getItem('isLogin') === 'true'
},
mutations: {
setLogin(state, val) {
state.isLogin = val
localStorage.setItem('isLogin', val)
},
logout(state) {
state.isLogin = false
localStorage.removeItem('isLogin')
}
}
})